﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using FlatRedBall;
using FlatRedBall.Graphics.Animation;
using FlatRedBall.Math.Geometry;
using HarpoonMan.WorldObjects;

namespace HarpoonMan.Utilities
{
    public static class ExtensionMethods
    {
        public static void PixelScale(this Sprite spr)
        {
            float pixelsPerUnit = SpriteManager.Camera.PixelsPerUnitAt(spr.Z);
            spr.ScaleX = .5f * spr.Texture.Width / pixelsPerUnit;
            spr.ScaleY = .5f * spr.Texture.Height / pixelsPerUnit;
        }

        public static float PixelPerUnit(this Sprite spr)
        {
            return SpriteManager.Camera.PixelsPerUnitAt(spr.Z);
        }

        public static void Destroy(this List<Trigger> slist)
        {
            foreach (Trigger s in slist)
            {
                s.Destroy();
            }
        }

        public static void Destroy(this List<Obstacle> olist)
        {
            foreach (Obstacle o in olist)
            {
                o.Destroy();
            }
        }
    }
}